/**
 */
package org.aphelie.romancer.model.chronicle.impl;

import org.aphelie.romancer.model.chronicle.ChroniclePackage;
import org.aphelie.romancer.model.chronicle.Personnage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Personnage</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.aphelie.romancer.model.chronicle.impl.PersonnageImpl#getVertue <em>Vertue</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class PersonnageImpl extends EObjectImpl implements Personnage {
	/**
	 * The default value of the '{@link #getVertue() <em>Vertue</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getVertue()
	 * @generated
	 * @ordered
	 */
	protected static final String VERTUE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getVertue() <em>Vertue</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getVertue()
	 * @generated
	 * @ordered
	 */
	protected String vertue = VERTUE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected PersonnageImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ChroniclePackage.Literals.PERSONNAGE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getVertue() {
		return vertue;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setVertue(String newVertue) {
		String oldVertue = vertue;
		vertue = newVertue;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ChroniclePackage.PERSONNAGE__VERTUE, oldVertue, vertue));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case ChroniclePackage.PERSONNAGE__VERTUE:
				return getVertue();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case ChroniclePackage.PERSONNAGE__VERTUE:
				setVertue((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case ChroniclePackage.PERSONNAGE__VERTUE:
				setVertue(VERTUE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case ChroniclePackage.PERSONNAGE__VERTUE:
				return VERTUE_EDEFAULT == null ? vertue != null : !VERTUE_EDEFAULT.equals(vertue);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (vertue: ");
		result.append(vertue);
		result.append(')');
		return result.toString();
	}

} //PersonnageImpl
